--- src/nnn.c
+++ src/nnn.c
@@ -28,7 +28,6 @@
 #include <sys/stat.h>
 #include <sys/statvfs.h>
 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
-# include <sys/types.h>
 #include <sys/event.h>
 #include <sys/time.h>
 #define BSD_KQUEUE
@@ -69,6 +68,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#include <sys/types.h>
 #include <unistd.h>
 #include <readline/history.h>
 #include <readline/readline.h>
